package c.e.a.b.f.b;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.job.JobScheduler;
import android.content.Context;
import android.content.Intent;
import android.os.Build.VERSION;

/* compiled from: com.google.android.gms:play-services-measurement@@18.0.0 */
public final class h9 extends i9 {
    public final AlarmManager d = ((AlarmManager) this.a.a.getSystemService("alarm"));
    public final i e;
    public Integer f;

    public h9(k9 k9Var) {
        super(k9Var);
        this.e = new g9(this, k9Var.j, k9Var);
    }

    public final boolean p() {
        this.d.cancel(u());
        if (VERSION.SDK_INT >= 24) {
            ((JobScheduler) this.a.a.getSystemService("jobscheduler")).cancel(t());
        }
        return false;
    }

    public final void s() {
        n();
        d().n.a("Unscheduling upload");
        this.d.cancel(u());
        this.e.c();
        if (VERSION.SDK_INT >= 24) {
            ((JobScheduler) this.a.a.getSystemService("jobscheduler")).cancel(t());
        }
    }

    public final int t() {
        if (this.f == null) {
            String str = "measurement";
            String valueOf = String.valueOf(this.a.a.getPackageName());
            this.f = Integer.valueOf((valueOf.length() != 0 ? str.concat(valueOf) : new String(str)).hashCode());
        }
        return this.f.intValue();
    }

    public final PendingIntent u() {
        Context context = this.a.a;
        return PendingIntent.getBroadcast(context, 0, new Intent().setClassName(context, "com.google.android.gms.measurement.AppMeasurementReceiver").setAction("com.google.android.gms.measurement.UPLOAD"), 0);
    }
}
